Field of the Invention
The present disclosure generally relates to image processing and, more particularly, to an image processing apparatus, an image processing method, and a storage medium that are suitably used for measuring a three-dimensional shape of a subject.
Description of the Related Art
Conventionally, a method is known in which a predetermined pattern is projected onto a subject, an image of the subject is captured, and a distortion of the predetermined pattern is calculated, whereby a three-dimensional shape of the subject and a surface distortion are obtained. More specifically, in a widely known method, the three-dimensional shape of the subject or a level of the surface deformation can be measured by capturing an image of the subject on which a random pattern is projected, and calculating, based on the captured image, a local displacement amount in the pattern projected on the subject through correlation calculation. As the correlation calculation in such a method, window matching between a projected random pattern generated by laser speckle and each partial area cut out from the captured image as described in Japanese Patent No. 2714152 is performed, for example.
However, the calculation in the window matching described above requires an area of a predetermined size or larger. The window matching is performed on the premise that all the points in the cutout partial area have the same displacement amount, that is, the same depth. Thus, a depth is calculated at an arbitrary point, being averaged with depths at surrounding points. This means that even in a case where, for example, an image of the projection pattern is captured with a favorable contrast, the depths are averaged, and thus measurement with high accuracy which is expected in this condition cannot be achieved.